{include file='index@common/header' /}
<div class="row">
    <div class="col-md-3">
        {include file='index@common/tags' /}
    </div>
    <div class="col-md-9">
        <div class="panel panel-default">
            <div class="panel-body">
                <h1 class="text-center">搜索</h1>
                <hr>
                <form class="form-horizontal well" method="get" action="{:url('content/content/search')}">
                    <div class="input-group">
                        <input type="text" name="q" class="form-control" value="{$q}" placeholder="Search for...">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="submit">搜索</button>
                        </span>
                    </div>
                </form>
                {notempty name='q'}
                    <hr>
                    {notempty name='lists'}
                        <div class="list-group">
                            {foreach name='lists' item='vo'}
                            <div class="list-group-item">
                                <a href="{$vo.url}">
                                    <h3>{:str_replace([$q],['<span style="color:red;font-weight: bolder;">'.$q.'</span>'],$vo['shorttitle'])}</h3>
                                </a>
                                <p>{:str_replace([$q],['<span style="color:red;font-weight: bolder;">'.$q.'</span>'],$vo['description'])}</p>
                            </div>
                            {/foreach}
                        </div>
                        {notempty name='page'}{$page}{/notempty}
                    {else/}
                        <div class="alert alert-danger">没有搜索到与 "<b class="text-danger"> {$q} </b>" 相关的结果</div>
                    {/notempty}
                {/notempty}
            </div>
        </div>
    </div>
</div>
{include file='index@common/footer' /}